<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录成功</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .success-container {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 300px;
            text-align: center;
        }
        .success-container h2 {
            color: #28a745;
            margin-bottom: 20px;
        }
        .success-container p {
            font-size: 14px;
            color: #333;
        }
    </style>
</head>
<body>
    <div class="success-container">
        <h2>登录成功！</h2>
        <p>您将在 <span id="countdown">5</span> 秒后自动跳转到主页...</p>
    </div>

    <script>
        // 设置倒计时时间（单位：秒）
        let countdownTime = 5;

        // 获取显示倒计时的元素
        const countdownElement = document.getElementById('countdown');

        // 倒计时函数
        const countdown = () => {
            countdownElement.textContent = countdownTime; // 更新倒计时显示
            countdownTime--; // 时间减1

            if (countdownTime < 0) {
                // 倒计时结束，跳转到指定页面
                window.location.href = "/index.html"; // 替换为目标页面的URL
            } else {
                // 继续倒计时
                setTimeout(countdown, 1000); // 每秒执行一次
            }
        };

        // 启动倒计时
        countdown();
    </script>
</body>
</html>